<HTML> 
<HEAD> 
	<TITLE>3rd Party ROBOTC Drivers</TITLE> 
<link href="tabs.css" rel="stylesheet" type="text/css"/> 
<link href="doxygen.css" rel="stylesheet" type="text/css"/> 
</HEAD> 
 
<BODY bgcolor="#ffffff" link="#000000" vlink="#000000"> 
<table width="100%" bgcolor="navy" cellspacing=0 cellpadding=1 border=0> 
<tr><td><table width="100%" bgcolor="#EEEEDD" cellspacing=0 cellpadding=3 border=0> 
<tr> 
    <td width="33%" align="left"> <img src="images/LOGO_NXT.gif" width=266 height=44 border="0" alt="Mindstorms"></td> 
    <td><b><font size="+3" color="navy">3rd Party ROBOTC Drivers</font></b></td> 
    <td align="right"> <img src="images/logo.png" width=44 height=44 border="0" alt="RobotC"></td>     
</tr> 
  <tr bgcolor="#cccc99" align="right"> 
          <td colspan=3> <font face="arial" size="-1"> [<a href=main.html>Home</a>] [<a target=_top href="https://sourceforge.net/projects/rdpartyrobotcdr/">Download</a>] [<a target=_top href="http://apps.sourceforge.net/mantisbt/rdpartyrobotcdr/my_view_page.php">Submit a bug/suggestion</a>]  [<a target=_top href="http://www.robotc.net/forums/">ROBOTC Forums</a>] [<a target=_top href="http://botbench.com">Blog</a>] [<a target=_top href="http://sourceforge.net/donate/index.php?group_id=257238">Support this project</a>]</font> </td> 
</tr> 
</table></td></tr> 
</table> 
<!-- Generated by Doxygen 1.7.2 -->
<div class="header">
  <div class="summary">
<a href="#files">Files</a> &#124;
<a href="#define-members">Defines</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<h1>RCX Sensor MUX<br/>
<small>
[<a class="el" href="group__mindsensors.html">Mindsensors</a>]</small>
</h1>  </div>
</div>
<div class="contents">
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="files"></a>
Files</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mindsensors-rcxsensorsmux_8h.html">mindsensors-rcxsensorsmux.h</a></td></tr>

<p><tr><td class="mdescLeft">&#160;</td><td class="mdescRight"><p>Mindsensors MSRXMUX RCX Sensor MUX Sensor driver. </p>
<br/></td></tr>
</p>
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__msrmux.html#gae6c250a3b51c81b4a492c185b0b6c84e">MSRXMUX_I2C_ADDR</a>&#160;&#160;&#160;0x7E</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__msrmux.html#ga97fdba20db66c0bf2d1d9ea818855511">MSRXMUX_CHAN1</a>&#160;&#160;&#160;0xFE</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__msrmux.html#ga44902a5e6d7916c863ff72be85a14373">MSRXMUX_CHAN2</a>&#160;&#160;&#160;0xFD</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__msrmux.html#gaf12c750cfcef6d01899986ed0d7c265d">MSRXMUX_CHAN3</a>&#160;&#160;&#160;0xFB</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__msrmux.html#ga7e6bcac120de7551331478bd3daf6c43">MSRXMUX_CHAN4</a>&#160;&#160;&#160;0xF7</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__msrmux.html#ga4aab7a3bd14f65bd245788ecbce5eb8c">MSRXMUX_NONE</a>&#160;&#160;&#160;0xFF</td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__msrmux.html#ga3727094d4840da4268c8e9dbe9830e89">MSRXMUXsetupChan</a> (tSensors link, ubyte chan, TSensorTypes chantype, TSensorModes chanmode, ubyte delay)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__msrmux.html#ga89d7741f1a1aee3279533ed2a6f37111">MSRXMUXreadChan</a> (tSensors link, byte chan)</td></tr>
<tr><td colspan="2"><h2><a name="var-members"></a>
Variables</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__msrmux.html#ga4a0f749a478d1028c48e7a2758b795f0">MSRXMUX_I2CRequest</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">TSensorTypes&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__msrmux.html#ga03f69005db0b4f1eb3721804909d6e9c">RCXSensorTypes</a> [4][4]</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">TSensorModes&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__msrmux.html#ga6db6cf6cd0016b3d6b924e336afb49d8">RCXSensorModes</a> [4][4]</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">ubyte&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__msrmux.html#gad42777352210e71b331bc730b273c7c1">RCXSensorDelays</a> [4][4] = {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>RCX Sensor MUX </p>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="ga97fdba20db66c0bf2d1d9ea818855511"></a><!-- doxytag: member="mindsensors&#45;rcxsensorsmux.h::MSRXMUX_CHAN1" ref="ga97fdba20db66c0bf2d1d9ea818855511" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MSRXMUX_CHAN1&#160;&#160;&#160;0xFE</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Select MUX channel 1 </p>

<p>Definition at line <a class="el" href="mindsensors-rcxsensorsmux_8h_source.html#l00043">43</a> of file <a class="el" href="mindsensors-rcxsensorsmux_8h_source.html">mindsensors-rcxsensorsmux.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga44902a5e6d7916c863ff72be85a14373"></a><!-- doxytag: member="mindsensors&#45;rcxsensorsmux.h::MSRXMUX_CHAN2" ref="ga44902a5e6d7916c863ff72be85a14373" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MSRXMUX_CHAN2&#160;&#160;&#160;0xFD</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Select MUX channel 2 </p>

<p>Definition at line <a class="el" href="mindsensors-rcxsensorsmux_8h_source.html#l00044">44</a> of file <a class="el" href="mindsensors-rcxsensorsmux_8h_source.html">mindsensors-rcxsensorsmux.h</a>.</p>

</div>
</div>
<a class="anchor" id="gaf12c750cfcef6d01899986ed0d7c265d"></a><!-- doxytag: member="mindsensors&#45;rcxsensorsmux.h::MSRXMUX_CHAN3" ref="gaf12c750cfcef6d01899986ed0d7c265d" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MSRXMUX_CHAN3&#160;&#160;&#160;0xFB</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Select MUX channel 3 </p>

<p>Definition at line <a class="el" href="mindsensors-rcxsensorsmux_8h_source.html#l00045">45</a> of file <a class="el" href="mindsensors-rcxsensorsmux_8h_source.html">mindsensors-rcxsensorsmux.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga7e6bcac120de7551331478bd3daf6c43"></a><!-- doxytag: member="mindsensors&#45;rcxsensorsmux.h::MSRXMUX_CHAN4" ref="ga7e6bcac120de7551331478bd3daf6c43" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MSRXMUX_CHAN4&#160;&#160;&#160;0xF7</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Select MUX channel 4 </p>

<p>Definition at line <a class="el" href="mindsensors-rcxsensorsmux_8h_source.html#l00046">46</a> of file <a class="el" href="mindsensors-rcxsensorsmux_8h_source.html">mindsensors-rcxsensorsmux.h</a>.</p>

</div>
</div>
<a class="anchor" id="gae6c250a3b51c81b4a492c185b0b6c84e"></a><!-- doxytag: member="mindsensors&#45;rcxsensorsmux.h::MSRXMUX_I2C_ADDR" ref="gae6c250a3b51c81b4a492c185b0b6c84e" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MSRXMUX_I2C_ADDR&#160;&#160;&#160;0x7E</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>I2C address for sensor </p>

<p>Definition at line <a class="el" href="mindsensors-rcxsensorsmux_8h_source.html#l00042">42</a> of file <a class="el" href="mindsensors-rcxsensorsmux_8h_source.html">mindsensors-rcxsensorsmux.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga4aab7a3bd14f65bd245788ecbce5eb8c"></a><!-- doxytag: member="mindsensors&#45;rcxsensorsmux.h::MSRXMUX_NONE" ref="ga4aab7a3bd14f65bd245788ecbce5eb8c" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MSRXMUX_NONE&#160;&#160;&#160;0xFF</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Deselect all MUX channels </p>

<p>Definition at line <a class="el" href="mindsensors-rcxsensorsmux_8h_source.html#l00047">47</a> of file <a class="el" href="mindsensors-rcxsensorsmux_8h_source.html">mindsensors-rcxsensorsmux.h</a>.</p>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga89d7741f1a1aee3279533ed2a6f37111"></a><!-- doxytag: member="mindsensors&#45;rcxsensorsmux.h::MSRXMUXreadChan" ref="ga89d7741f1a1aee3279533ed2a6f37111" args="(tSensors link, byte chan)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int MSRXMUXreadChan </td>
          <td>(</td>
          <td class="paramtype">tSensors&#160;</td>
          <td class="paramname"> <em>link</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">byte&#160;</td>
          <td class="paramname"> <em>chan</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="mindsensors-rcxsensorsmux-test1_8c-example.html#a1">mindsensors-rcxsensorsmux-test1.c</a>.</dd>
</dl>
<p>Definition at line <a class="el" href="mindsensors-rcxsensorsmux_8h_source.html#l00081">81</a> of file <a class="el" href="mindsensors-rcxsensorsmux_8h_source.html">mindsensors-rcxsensorsmux.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga3727094d4840da4268c8e9dbe9830e89"></a><!-- doxytag: member="mindsensors&#45;rcxsensorsmux.h::MSRXMUXsetupChan" ref="ga3727094d4840da4268c8e9dbe9830e89" args="(tSensors link, ubyte chan, TSensorTypes chantype, TSensorModes chanmode, ubyte delay)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void MSRXMUXsetupChan </td>
          <td>(</td>
          <td class="paramtype">tSensors&#160;</td>
          <td class="paramname"> <em>link</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ubyte&#160;</td>
          <td class="paramname"> <em>chan</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">TSensorTypes&#160;</td>
          <td class="paramname"> <em>chantype</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">TSensorModes&#160;</td>
          <td class="paramname"> <em>chanmode</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ubyte&#160;</td>
          <td class="paramname"> <em>delay</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Send a direct command to the MUX sensor</p>
<p>Note: this is an internal command and should not be called directly. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">link</td><td>the PFMate port number </td></tr>
    <tr><td class="paramname">chan</td><td>the channel to be configured </td></tr>
    <tr><td class="paramname">chantype</td><td>the sensor type connected to the channel </td></tr>
    <tr><td class="paramname">chanmode</td><td>the sensor mode of the sensor </td></tr>
    <tr><td class="paramname">delay</td><td>the initialisation delay time </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if no error occured, false if it did </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="mindsensors-rcxsensorsmux-test1_8c-example.html#a0">mindsensors-rcxsensorsmux-test1.c</a>.</dd>
</dl>
<p>Definition at line <a class="el" href="mindsensors-rcxsensorsmux_8h_source.html#l00072">72</a> of file <a class="el" href="mindsensors-rcxsensorsmux_8h_source.html">mindsensors-rcxsensorsmux.h</a>.</p>

</div>
</div>
<hr/><h2>Variable Documentation</h2>
<a class="anchor" id="ga4a0f749a478d1028c48e7a2758b795f0"></a><!-- doxytag: member="mindsensors&#45;rcxsensorsmux.h::MSRXMUX_I2CRequest" ref="ga4a0f749a478d1028c48e7a2758b795f0" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a> <a class="el" href="group__msrmux.html#ga4a0f749a478d1028c48e7a2758b795f0">MSRXMUX_I2CRequest</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Array to hold I2C command data </p>

<p>Definition at line <a class="el" href="mindsensors-rcxsensorsmux_8h_source.html#l00049">49</a> of file <a class="el" href="mindsensors-rcxsensorsmux_8h_source.html">mindsensors-rcxsensorsmux.h</a>.</p>

</div>
</div>
<a class="anchor" id="gad42777352210e71b331bc730b273c7c1"></a><!-- doxytag: member="mindsensors&#45;rcxsensorsmux.h::RCXSensorDelays" ref="gad42777352210e71b331bc730b273c7c1" args="[4][4]" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ubyte <a class="el" href="group__msrmux.html#gad42777352210e71b331bc730b273c7c1">RCXSensorDelays</a>[4][4] = {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="mindsensors-rcxsensorsmux_8h_source.html#l00059">59</a> of file <a class="el" href="mindsensors-rcxsensorsmux_8h_source.html">mindsensors-rcxsensorsmux.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga6db6cf6cd0016b3d6b924e336afb49d8"></a><!-- doxytag: member="mindsensors&#45;rcxsensorsmux.h::RCXSensorModes" ref="ga6db6cf6cd0016b3d6b924e336afb49d8" args="[4][4]" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TSensorModes <a class="el" href="group__msrmux.html#ga6db6cf6cd0016b3d6b924e336afb49d8">RCXSensorModes</a>[4][4]</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>Initial value:</b><div class="fragment"><pre class="fragment"> {{modeRaw, modeRaw, modeRaw, modeRaw},
                                     {modeRaw, modeRaw, modeRaw, modeRaw},
                                     {modeRaw, modeRaw, modeRaw, modeRaw},
                                     {modeRaw, modeRaw, modeRaw, modeRaw}}
</pre></div>
<p>Definition at line <a class="el" href="mindsensors-rcxsensorsmux_8h_source.html#l00055">55</a> of file <a class="el" href="mindsensors-rcxsensorsmux_8h_source.html">mindsensors-rcxsensorsmux.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga03f69005db0b4f1eb3721804909d6e9c"></a><!-- doxytag: member="mindsensors&#45;rcxsensorsmux.h::RCXSensorTypes" ref="ga03f69005db0b4f1eb3721804909d6e9c" args="[4][4]" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TSensorTypes <a class="el" href="group__msrmux.html#ga03f69005db0b4f1eb3721804909d6e9c">RCXSensorTypes</a>[4][4]</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>Initial value:</b><div class="fragment"><pre class="fragment"> {{sensorNone, sensorNone, sensorNone, sensorNone},
                                     {sensorNone, sensorNone, sensorNone, sensorNone},
                                     {sensorNone, sensorNone, sensorNone, sensorNone},
                                     {sensorNone, sensorNone, sensorNone, sensorNone}}
</pre></div>
<p>Definition at line <a class="el" href="mindsensors-rcxsensorsmux_8h_source.html#l00051">51</a> of file <a class="el" href="mindsensors-rcxsensorsmux_8h_source.html">mindsensors-rcxsensorsmux.h</a>.</p>

</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Wed Mar 13 2013 19:56:44 for ROBOTC Drivers by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.2 </small></address>
</body>
</html>
